function SwichUrl(url){
	$("#iframe").attr("src",url);
	InitLayUI();
}

function SkipUrl(url){
	$("#iframe").attr("src",url);
}

var mylayui;

function InitLayUI(){
	layui.use('layer', function(){
		mylayui = layui.layer;
	})
}

function CloseOpenWindow(){
	mylayui.closeAll('iframe');
}


function InitEleUI(){
	layui.use(['element','carousel','form'], function(){
		var form = layui.form;
		var element = layui.element;
		
	})
}

$(function(){
	InitLayUI();
	
	$("#youbian").height($(window).height()-45);
	$("#zezao").click(function(){
		ShowCb("hide");
		ShowUserinfo("hide");
	});
})

function ShowUserinfo(flag){
	if($("#divopuserinfo").is(":hidden")){
		if(!flag){
			$("#zezao").show();
			$("#userinfomore").addClass("xuanzhuan");
			$("#divopuserinfo").slideDown();
		}
	}
	else{
		$("#userinfomore").removeClass("xuanzhuan");
		$("#divopuserinfo").slideUp();
		$("#zezao").hide();
	}
	
}

function ChangePwd(){
	mylayui.open({
        type: 2,
        title: '修改密码',
        shadeClose: true,
        shade: 0.5,
        area: ['500px', '300px'],
        content: 'changepwd'
      }); 
}

function CloseDialog(result,msg){
	if(result>0){
		mylayui.msg('操作成功', {icon: 1});
		mylayui.closeAll('iframe');
	}
	else{
		if(msg){
			mylayui.msg(msg, {icon: 0});
		}else{
			mylayui.msg('操作失败', {icon: 0});
		}
	}
}


function ShowCb(flag){
	if($("#youbian").is(":hidden")){
		if(!flag){
			$("#zezao").show();
			$("#youbian").show();
			$("#youbian").animate({width:"250px"},500);
		}
	}
	else{
		
		$("#youbian").animate({width:"0"},500,function(){
			$("#zezao").hide();
			$("#youbian").hide();
		});
	}
	
}


function ShowZheZhao(){
	if($("#zezao").is(":hidden")){
		$("#zezao").show();
		mylayui.load();
	}
	else{
		mylayui.closeAll('loading');
		$("#zezao").hide();
	}
}
